#ifndef RISING_STAR_TCP_SERVER_H
#define RISING_STAR_TCP_SERVER_H

#include "Config.h"
#include "Services.h"

#include "TCPSession.h"

using namespace boost::asio;
using namespace boost;



namespace RisingStar
{
	class CTCPServer:public boost::noncopyable
	{


private:
    

	
	public:
		explicit CTCPServer(WORD port);
		~CTCPServer();
		void HandleAccept(CTCPSession* newSession, const boost::system::error_code& error);
		void Run();
		
		
	protected:
		CServices mServices;
		ip::tcp::acceptor mAcceptor;

		//asio::io_service mService;
		//IOServicePtr mServicePtr;
		bool CreateNewSession();
		
		//服务处理
		void ServicesProcess();
	};
	
	
}

#endif
